package com.happiness.gateway.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * 切面拦截
 * */
@Aspect
@Component
public class CustomFeignClientAspect {
    // 配置织入点
    @Pointcut("@annotation(com.happiness.gateway.annotation.CustomFeignClient)")
    public void CustomFeignClient() {
    }

    /**
     * 处理完请求后执行
     *
     * @param joinPoint 切点
     */
    @AfterReturning(pointcut = "CustomFeignClient()", returning = "jsonResult")
    public void doAfterReturning(JoinPoint joinPoint, Object jsonResult){
        System.out.println(joinPoint);
        System.out.println(jsonResult);
    }


}
